﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Collections.ObjectModel;

namespace HtmlExtractor
{
    /// <summary>
    /// 组合组split没有意思。不支持split
    /// </summary>
    public class CompositeItem:Collection<SimpleItem>,IPageItem
    {  
        
        //public string GetStringOutputPath()
        //{
        //    string split = ",";
        //    var outpaths = from s in Items
        //                   orderby s.OutputPath
        //                   select s.OutputPath;
        //    return outpaths.Aggregate((a, b) => a + split + b);


        //}
        #region IPageItem Members

        public new ResultType GetType()
        {
            return ResultType.CompositeItem;
        }       

        public List<string> GetOutputPath()
        {
            var outpaths = from s in Items
                           orderby s.OutputPath
                           select s.OutputPath;
            return outpaths.ToList();
        }
        public List<string> GetValue()
        {
            return (from v in Items select v.Value).ToList();
        }
        #endregion
    }
}
